$radio-prefix-cls: "#{$css-prefix}radio";
$radio-group-prefix-cls: "#{$radio-prefix-cls}-group";
$radio-inner-prefix-cls: "#{$radio-prefix-cls}-inner";
$radio-group-button-prefix-cls: "#{$radio-group-prefix-cls}-button";

.#{$radio-group-prefix-cls} {
    display: inline-block;
    // font-size: $font-size-base;
    vertical-align: middle;
    // height: $form-component-height;
    &-vertical{
        .#{$radio-prefix-cls}-wrapper {
            display: block;
            height: $radio-vertical-wrapper-height;
            line-height: $radio-vertical-wrapper-height;
        }
    }
    & ~ .verify-tip.verify-bottom {
        margin-top:$radio-vertical-verify-tip-margin-top;
    }
}

// 普通状态
.#{$radio-prefix-cls}-wrapper {
    font-size: $radio-wrapper-font-size;
    vertical-align: middle;
    display: inline-block;
     // c1 repair radio and checkbox group component in form layout problem
    line-height: 1;
    position: relative;
    white-space: nowrap;
    margin-right: $radio-wrapper-margin-right;
    cursor: pointer;
    &-disabled{
      cursor: $cursor-disabled;
    }
    .iconfont{
      font-size: $font-size-base;
    }
}

.#{$radio-prefix-cls} {
    display: inline-block;
    margin-right: $radio-wrapper-margin-right;
    white-space: nowrap;
    outline: none;
    position: relative;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    &:hover {
        .#{$radio-inner-prefix-cls} {
            border-color: $primary-color;
        }
    }
    &-inner {
      display: inline-block;
      width: $radio-inner-width;
      height: $radio-inner-height;
      position: relative;
      top: $radio-inner-top;
      left: $radio-inner-left;
      background-color: $radio-inner-background-color;
      border: 1px solid $border-color-base;
      border-radius: 50%;
      transition: all $transition-time $ease-in-out;

      &:after {
          position: absolute;
          width:$radio-inner-after-width;
          height: $radio-inner-after-height;
          left: $radio-inner-after-left;
          top: $radio-inner-after-top;
          border-radius: $border-radius-base;
          display: table;
          border-top: 0;
          border-left: 0;
          content: ' ';
          background-color: $primary-color;
          opacity: 0;
          transition: all $transition-time $ease-in-out;
          transform: scale(0);
      }
    }
    &-large{
        font-size: $font-size-base;
        & .#{$radio-inner-prefix-cls}{
            width: $radio-large-inner-width;
            height: $radio-large-inner-height;
            &:after{
                width: $radio-large-inner-after-width;
                height: $radio-large-inner-after-height;
            }
        }
        &.#{$radio-prefix-cls}-wrapper, & .#{$radio-prefix-cls}-wrapper{
            font-size: $font-size-base;
        }
    }
    &-small{
        & .#{$radio-inner-prefix-cls}{
            width: $radio-small-inner-width;
            height: $radio-small-inner-height;
            &:after{
                width: $radio-small-inner-after-width;
                height: $radio-small-inner-after-height;
            }
        }
    }

    &-input {
        position: absolute;
        top: $radio-input-top;
        bottom: $radio-input-bottom;
        left: $radio-input-left;
        right: $radio-input-right;
        z-index: 1;
        opacity: $radio-input-opacity;
        cursor: pointer;
    }
    &-inner-focus {
        @include active();
    }
}

// 选中状态
.#{$radio-prefix-cls}-checked {
    .#{$radio-inner-prefix-cls} {
        border-color: $primary-color;
        &:after {
            opacity: 1;
            transform: scale(1);
            transition: all $transition-time $ease-in-out;
        }
    }
    &:hover {
        .#{$radio-inner-prefix-cls} {
            border-color: $primary-color;
        }
    }
}

.#{$radio-prefix-cls}-disabled {
    cursor: $cursor-disabled;
    .#{$radio-prefix-cls}-input {
        cursor: $cursor-disabled;
    }

    &:hover {
        .#{$radio-inner-prefix-cls} {
            border-color: $border-color-base;
        }
    }
    .#{$radio-inner-prefix-cls} {
        border-color:$radio-disabled-inner-border-color;
        background-color: $radio-inner-color;
        &:after {
            background-color: $radio-inner-after-color;
        }
    }

    .#{$radio-prefix-cls}-disabled + span {
        color: $radio-disabled-span-color;
    }
}

span.#{$radio-prefix-cls} + * {
    margin-left: $radio-span-margin-left;
    margin-right: $radio-span-margin-right;
}

// 按钮样式
.#{$radio-group-button-prefix-cls} {
    font-size: 0;
    -webkit-text-size-adjust:none;

    .#{$radio-prefix-cls}{
        width: 0;
        margin-right: 0;
    }

    .#{$radio-prefix-cls}-wrapper {
        display: inline-block;
        height: $btn-circle-size;
        line-height: $btn-circle-size - 2px;
        margin: $radio-group-button-wrapper-margin;
        padding:$radio-group-button-wrapper-padding;
        font-size: $font-size-small;
        color: $btn-default-color;
        transition: all $transition-time ease-in-out;
        cursor: pointer;
        border: 1px solid $border-color-base;
        border-left: 0;
        background: $radio-group-button-wrapper-background;

        > span {
            margin-left: 0;
        }

        &:before {
            content: '';
            position: absolute;
            width: 1px;
            height: 100%;
            left: -1px;
            background: $border-color-base;
            visibility: hidden;
            transition: all $transition-time ease-in-out;
        }

        &:first-child {
            border-radius: $btn-border-radius 0 0 $btn-border-radius;
            border-left: 1px solid $border-color-base;
            &:before {
                display: none;
            }
        }

        &:last-child {
            border-radius: 0 $btn-border-radius $btn-border-radius 0;
        }

        &:first-child:last-child {
            border-radius: $btn-border-radius;
        }

        &:hover {
            position: relative;
            color: $primary-color;
        }

        .#{$radio-prefix-cls}-inner {
            // opacity: 0;
            display: none;
            width: 0;
            height: 0;
        }
        input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        &-checked {
            background: $radio-group-button-wrapper-checked-color;
            border-color: $primary-color;
            color: $primary-color;
            box-shadow: -1px 0 0 0 $primary-color;

            &:first-child {
                border-color: $primary-color;
                box-shadow: none!important;
            }

            &:hover {
                border-color: lighten($primary-color, 10%);
                box-shadow: -1px 0 0 0 tint($primary-color, 20%);
                color: lighten($primary-color, 20%);
            }

            &:active {
                border-color: shade($primary-color, 5%);
                box-shadow: -1px 0 0 0 shade($primary-color, 5%);
                color: darken($primary-color, 5%);
            }
        }

        &-disabled {
            border-color: $border-color-base;
            background-color: $background-color-base;
            cursor: $cursor-disabled;
            color: $radio-group-button-wrapper-disabled-color;

            &:first-child,
            &:hover {
                border-color: $border-color-base;
                background-color: $background-color-base;
                color: $radio-group-button-wrapper-disabled-hover-color;
            }
            &:first-child {
                border-left-color: $border-color-base;
            }
        }

        &-disabled.#{$radio-prefix-cls}-wrapper-checked {
            color: $radio-group-button-wrapper-disabled-wrapper-checked-color;
            background-color: $radio-group-button-wrapper-disabled-wrapper-checked-background-color;
            border-color: $border-color-base;
            box-shadow: none!important;
        }
        // btn 带按钮--o45
        .#{$radio-prefix-cls}-btnIcon.#{$radio-prefix-cls} {
            width:$radio-group-button-wrapper-btnIcon-width;
            .#{$radio-prefix-cls}-inner {
                // opacity: 1;
                display: inline-block;
                width: $radio-group-button-wrapper-btnIcon-inner-width;
                height: $radio-group-button-wrapper-btnIcon-inner-height;
            }
        }
    }
}

.#{$radio-group-button-prefix-cls}.#{$radio-group-prefix-cls}-large .#{$radio-prefix-cls}-wrapper{
    height: $btn-circle-size-large;
    line-height: $btn-circle-size-large - 2px;
    font-size: $font-size-small;
    .#{$radio-prefix-cls}-btnIcon.#{$radio-prefix-cls} {
        width: $radio-group-button-large-btnIcon-width;
        .#{$radio-prefix-cls}-inner {
            // opacity: 1;
            display: inline-block;
            width: $radio-group-button-large-btnIcon-inner-width;
            height: $radio-group-button-large-btnIcon-inner-height;
        }
    }
}

.#{$radio-group-button-prefix-cls}.#{$radio-group-prefix-cls}-small .#{$radio-prefix-cls}-wrapper{
    height: $btn-circle-size-small;
    line-height: $btn-circle-size-small - 2px;
    padding:$radio-group-button-small-wrapper-padding;
    font-size: $font-size-small;
    &:first-child {
        border-radius: $btn-border-radius-small 0 0 $btn-border-radius-small;
    }
    &:last-child {
        border-radius: 0 $btn-border-radius-small $btn-border-radius-small 0;
    }
    .#{$radio-prefix-cls}-btnIcon.#{$radio-prefix-cls} {
        width: 16px;
        .#{$radio-prefix-cls}-inner {
            // opacity: 1;
            display: inline-block;
            width: $radio-group-button-small-btnIcon-inner-width;
            height: $radio-group-button-small-btnIcon-inner-height;
        }
    }
}
